<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  	<meta charset="UTF-8">
	<title>CRM后台审核管理</title>
	<link rel="stylesheet" href="../css/bootstrap-datetimepicker.min.css" />
	<link rel="stylesheet" href="../css/fileinput.min.css" />
	<link rel="stylesheet" href="../css/bootstrap-editable.css" />
	<link rel="stylesheet" href="../css/bootstrap.min.css" />
	<script src="../js/jquery-1.11.1.js"></script>
	<script src="../js/bootstrap.min.js"></script>
	<script src="../js/bootstrap-datetimepicker.min.js"></script>
	<script src="../js/bootstrap-datetimepicker.zh-CN.js"></script>
	<script src="http://cdn.bootcss.com/jquery-validate/1.14.0/jquery.validate.min.js"></script>
	<script src="http://cdn.bootcss.com/jquery-validate/1.14.0/additional-methods.min.js"></script>
	<script src="../js/messages_zh.js"></script>
	<script src="../js/fileinput.min.js"></script>
	<script src="../js/fileinput_locale_zh.js"></script>
	<script src="../js/bootstrap-editable.min.js"></script>
	<style>
		body{margin:70px}
	</style>
	<script  type="text/javascript">
		$(function(){
			$('#userinfo').css('display','block');
			$('#alterUserinfo').css('display','block');
			$('#writeUserinfo').click(function(){
				$('#userinfo').css('display','none');
				$('#alterUserinfo').css('display','block');
			})
			var a = 1;
			$('#addContactWay').click(function(){
				if(a < 4){
					a++;
					console.log(a);
					var contactWay = '<div class="form-group"><div class="col-xs-4 text-right"><select class="form-control" id="type" style="width:80px;margin-left:15px"><option>手机</option><option>QQ</option><option>邮箱</option><option>座机</option></select></div><div class="col-xs-8"><div class="row"><div class="col-xs-10"><input class="form-control" id="content" /></div><div class="col-xs-2" id="removeContact'+a+'" style="margin-top:10px;"><span class="glyphicon glyphicon-remove"></span></div></div></div></div>'
					$(contactWay).appendTo($('#contact'));
					
					var b = $('#removeContact'+a).parent().parent().parent();
					$('#removeContact'+a).click(function(){
						b.remove();
						$('#div').remove();
						a--;
					})
				}else{
					if($('#div').length<1){
						$('<div>',{html:"最多只能有4条联系方式",'id':'div'}).appendTo($('#contact'))
					}
				}
			})
			$('#saveUserinfo').click(function(){
				for(var b = 0; b < $('#alterContactWay input').length; b ++){
					$('#alterContactWay input').eq(b).val();
					console.log();
				}
				$.ajax({
					url:'#',
					data:{
						name:$('#alterContactWay input').eq(1).val(),
						sex:$('#alterContactWay input').eq(2).val(),
						ID:$('#alterContactWay input').eq(3).val(),
						where:$('#alterContactWay input').eq(4).val(),
						date:$('#alterContactWay input').eq(5).val(),
						contact1:$('#alterContactWay input').eq(6).val(),
						contact2:$('#alterContactWay input').eq(7).val(),
						contact3:$('#alterContactWay input').eq(8).val(),
						contact4:$('#alterContactWay input').eq(9).val(),
						type1:$('#type').ep(1).val(),
						type2:$('#type').ep(2).val(),
						type3:$('#type').ep(3).val(),
						type4:$('#type').ep(4).val(),
					},
					type:'post',
					dataType:'JSON',
					success:function(data){
						var f = $('#login-panel-body #false-message');
						var t = $('#login-panel-body #true-message');
						if(data.success){
							if(t.length<1){
								$('<div>',{html:data.msg,'id':'true-message','style':'text-align:center;color:green'}).appendTo($('#login-panel-body'))
							}
							setTimeout(function(){
							},1000);
						}else{
							if(f.length<1){
								$('<div>',{html:data.msg,'id':'false-message','style':'text-align:center;color:red'}).appendTo($('#login-panel-body'))
							}else{
								$('#false-message').html(data.msg);
							}
						}
					}
				})
			})
			$('#seeUserinfo').click(function(){
				$('#userinfo').css('display','block');
				$('#alterUserinfo').css('display','none');
			})
		})
	</script>
</head>
<body>
	<div class="container" style="width:1000px;">
	 	<nav class="navbar navbar-default navbar-fixed-top" style="margin:auto;width:1000px">
		  <div class="container-fluid">
		    <!-- Brand and toggle get grouped for better mobile display -->
		    <div class="navbar-header">
		      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
		        <span class="sr-only">Toggle navigation</span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		        <span class="icon-bar"></span>
		      </button>
		      <a class="navbar-brand" href="#"><b><span style="color:blue">诚信金融</span></b></a>
		    </div>
		
		    <!-- Collect the nav links, forms, and other content for toggling -->
		    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
		      <ul class="nav navbar-nav">
		        <li><a href="#">公司介绍</a></li>
		        <li class="dropdown">
		          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">办理款项<span class="caret"></span></a>
		          <ul class="dropdown-menu">
		          	<li><a href="home.html">全部项目</a></li>
		            <li role="separator" class="divider"></li>
		            <li><a href="home.html">公司贷款</a></li>
		            <li><a href="home.html">个体户贷款</a></li>
		          </ul>
		        </li>
				<li class="dropdown">
		          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">我的款项<span class="caret"></span></a>
		          <ul class="dropdown-menu">
		            <li><a href="user.html">全部项目</a></li>
		            <li role="separator" class="divider"></li>
		            <li><a href="user.html">已申请项目</a></li>
		            <li><a href="user.html">已通过项目</a></li>
		            <li><a href="user.html">过期项目</a></li>
		          </ul>
		        </li>
		      </ul>
		      <form class="navbar-form navbar-left" role="search" action=".php">
		        <div class="form-group">
		          <input type="text" class="form-control" placeholder="Search" />
		        </div>
		        <button type="submit" class="btn btn-default">搜索
					<span class="glyphicon glyphicon-search"></span>
				</button>
		      </form>
		      <ul class="nav navbar-nav navbar-right">
		        <li><a href="userinfo.html">user</a></li>
		        <li class="dropdown">
		          <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">选项<span class="caret"></span></a>
		          <ul class="dropdown-menu">
		            <li><a href="log.html">更换帐号</a></li>
		            <li role="separator" class="divider"></li>
		            <li><a href="log.html">退出登录</a></li>
		          </ul>
		        </li>
		      </ul>
		    </div><!-- /.navbar-collapse -->
		  </div><!-- /.container-fluid -->
		</nav>
	</div>
	<div class="container" id="userinfo" style="width: 1000px;position:relative;">
		<div class="row">
			<div class="panel panel-primary">
            	<div class="panel-heading">
                	<div class="panel-title text-center">
						个人信息
                    </div>
                </div>
				<div id="logon-panel-body" class="panel-body" style="width:400px;margin:auto;">
					<div style="text-align:center;">
						<b>用户信息</b>
					</div>
					<hr />
            		<div class="row" style="margin-top:25px">
                		<div class="col-xs-4 text-right">
                    			用户姓名：
                		</div>
                    	<div class="col-xs-8">
							<span>李四</span>
						</div>
					</div>
					<div class="row" style="margin-top:30px">
                		<div class="col-xs-4 text-right">
                    			性别：
                		</div>
                    	<div class="col-xs-8">
							<span>男</span>
						</div>
					</div>
					<div class="row" style="margin-top:30px">
                		<div class="col-xs-4 text-right">
                    			身份证：
                		</div>
                    	<div class="col-xs-8">
							<span>132131</span>
						</div>
					</div>
					<div class="row" style="margin-top:30px">
                		<div class="col-xs-4 text-right">
                    			联系地址：
                		</div>
                    	<div class="col-xs-8">
							<span>德阳</span>
						</div>
					</div>
					<div class="row" style="margin-top:30px">
                		<div class="col-xs-4 text-right">
                    			出生日期：
                		</div>
                    	<div class="col-xs-8">
							<span>2000-1-1</span>
						</div>
					</div>
					<br />
					<div style="text-align:center;margin-top:20px">
						<b>联系方式</b>
					</div>
					<hr />
					<div class="row" style="margin-top:30px">
                		<div class="col-xs-4 text-right">
                    			手机：
                		</div>
                    	<div class="col-xs-8">
							<span>12313</span>
						</div>
					</div>
				</div>
				<div class="panel-footer" style="text-align:center" >
					<button id="writeUserinfo" class="btn btn-info">修改信息</button>
				</div>
			</div>
		</div>
	</div>
	<div class="container" id="alterUserinfo"  style="width: 1000px;position:relative;">
		<div class="row" >
			<div class="panel panel-primary">
            	<div class="panel-heading">
                	<div class="panel-title text-center">
						个人信息
                    </div>
                </div>
				<div id="logon-panel-body" class="panel-body" style="width:400px;margin:auto;">
					<form class="form-horizontal" id="alterContactWay">
						<div style="text-align:center;">
							<b>用户信息</b>
						</div>
						<hr />
	            		<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			用户姓名：
	                		</div>
	                    	<div class="col-xs-8">
								<input class="form-control" />
							</div>
						</div>
						<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			性别：
	                		</div>
	                    	<div class="col-xs-8">
								<input class="form-control" />
							</div>
						</div>
						<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			身份证：
	                		</div>
	                    	<div class="col-xs-8">
								<input class="form-control" />
							</div>
						</div>
						<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			联系地址：
	                		</div>
	                    	<div class="col-xs-8">
								<input class="form-control" />
							</div>
						</div>
						<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			出生日期：
	                		</div>
	                    	<div class="col-xs-8">
								<input class="form-control" />
							</div>
						</div>
						<br />
						<div style="text-align:center">
							<b>联系方式</b>
						</div>
						<hr />
						<div id="contact">
							<div class="form-group" id="contactWay">
		                		<div class="col-xs-4 text-right">
		                    		<select class="form-control" id="type" style="width:80px;margin-left:15px">
		                    			<option>手机</option>
		                    			<option>QQ</option>
		                    			<option>邮箱</option>
		                    			<option>座机</option>
		                    		</select>
		                		</div>
		                    	<div class="col-xs-8">
		                    		<div class="row">
		                    			<div class="col-xs-10">
											<input class="form-control" id="content" />
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="form-group">
	                		<div class="col-xs-4 text-right" style="margin-top:7px">
	                    			
	                		</div>
	                    	<div class="col-xs-8">
								<div class="btn btn-default" id="addContactWay">
									<span class="glyphicon glyphicon-plus"></span>
								</div>
							</div>
						</div>
					</form>
				</div>
				<div class="panel-footer" style="text-align:center">
					<button id="saveUserinfo" class="btn btn-info">保存信息</button>
					<button id="seeUserinfo" class="btn btn-info">返回</button>
				</div>
			</div>
		</div>
	</div>
</body>
</html>
